Optimal. Leaf size=92 \[ \frac {2 i a^2 (a+i a \tan (e+f x))^{-n} (d \sec (e+f x))^{2 n}}{f n (n+1)}+\frac {i a (a+i a \tan (e+f x))^{1-n} (d \sec (e+f x))^{2 n}}{f (n+1)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.13, antiderivative size = 92, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 32, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.062, Rules used = {3494, 3493} \[ \frac {2 i a^2 (a+i a \tan (e+f x))^{-n} (d \sec (e+f x))^{2 n}}{f n (n+1)}+\frac {i a (a+i a \tan (e+f x))^{1-n} (d \sec (e+f x))^{2 n}}{f (n+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3493
Rule 3494
Rubi steps
\begin {align*} \int (d \sec (e+f x))^{2 n} (a+i a \tan (e+f x))^{2-n} \, dx &=\frac {i a (d \sec (e+f x))^{2 n} (a+i a \tan (e+f x))^{1-n}}{f (1+n)}+\frac {(2 a) \int (d \sec (e+f x))^{2 n} (a+i a \tan (e+f x))^{1-n} \, dx}{1+n}\\ &=\frac {i a (d \sec (e+f x))^{2 n} (a+i a \tan (e+f x))^{1-n}}{f (1+n)}+\frac {2 i a^2 (d \sec (e+f x))^{2 n} (a+i a \tan (e+f x))^{-n}}{f n (1+n)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 1.17, size = 61, normalized size = 0.66 \[ -\frac {a^2 (n \tan (e+f x)-i (n+2)) (a+i a \tan (e+f x))^{-n} (d \sec (e+f x))^{2 n}}{f n (n+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.97, size = 139, normalized size = 1.51 \[ \frac {{\left ({\left (i \, n + i\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (i \, n + 2 i\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + i\right )} \left (\frac {2 \, d e^{\left (i \, f x + i \, e\right )}}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}\right )^{2 \, n} e^{\left (-i \, e n + {\left (-i \, f n + 2 i \, f\right )} x - 4 i \, f x - {\left (n - 2\right )} \log \left (\frac {2 \, d e^{\left (i \, f x + i \, e\right )}}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}\right ) - {\left (n - 2\right )} \log \left (\frac {a}{d}\right ) - 2 i \, e\right )}}{2 \, {\left (f n^{2} + f n\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (d \sec \left (f x + e\right )\right )^{2 \, n} {\left (i \, a \tan \left (f x + e\right ) + a\right )}^{-n + 2}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 3.62, size = 0, normalized size = 0.00 \[ \int \left (d \sec \left (f x +e \right )\right )^{2 n} \left (a +i a \tan \left (f x +e \right )\right )^{2-n}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.68, size = 304, normalized size = 3.30 \[ \frac {2^{n + 1} a^{2} d^{2 \, n} \cos \left (n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right ) - i \cdot 2^{n + 1} a^{2} d^{2 \, n} \sin \left (n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right ) + 2 \, {\left (a^{2} d^{2 \, n} n + a^{2} d^{2 \, n}\right )} 2^{n} \cos \left (-2 \, f x + n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right ) - 2 \, e\right ) - {\left (2 i \, a^{2} d^{2 \, n} n + 2 i \, a^{2} d^{2 \, n}\right )} 2^{n} \sin \left (-2 \, f x + n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right ) - 2 \, e\right )}{{\left (-i \, a^{n} n^{2} - i \, a^{n} n + {\left (-i \, a^{n} n^{2} - i \, a^{n} n\right )} \cos \left (2 \, f x + 2 \, e\right ) + {\left (a^{n} n^{2} + a^{n} n\right )} \sin \left (2 \, f x + 2 \, e\right )\right )} {\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac {1}{2} \, n} f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 7.82, size = 260, normalized size = 2.83 \[ -{\mathrm {e}}^{-e\,4{}\mathrm {i}-f\,x\,4{}\mathrm {i}}\,{\left (\frac {d}{\frac {{\mathrm {e}}^{-e\,1{}\mathrm {i}-f\,x\,1{}\mathrm {i}}}{2}+\frac {{\mathrm {e}}^{e\,1{}\mathrm {i}+f\,x\,1{}\mathrm {i}}}{2}}\right )}^{2\,n}\,\left (\frac {{\left (a-\frac {a\,\left ({\mathrm {e}}^{e\,2{}\mathrm {i}+f\,x\,2{}\mathrm {i}}\,1{}\mathrm {i}-\mathrm {i}\right )\,1{}\mathrm {i}}{{\mathrm {e}}^{e\,2{}\mathrm {i}+f\,x\,2{}\mathrm {i}}+1}\right )}^{2-n}}{2\,f\,n\,\left (n\,1{}\mathrm {i}+1{}\mathrm {i}\right )}+\frac {{\mathrm {e}}^{e\,2{}\mathrm {i}+f\,x\,2{}\mathrm {i}}\,{\left (a-\frac {a\,\left ({\mathrm {e}}^{e\,2{}\mathrm {i}+f\,x\,2{}\mathrm {i}}\,1{}\mathrm {i}-\mathrm {i}\right )\,1{}\mathrm {i}}{{\mathrm {e}}^{e\,2{}\mathrm {i}+f\,x\,2{}\mathrm {i}}+1}\right )}^{2-n}\,\left (n+2\right )}{2\,f\,n\,\left (n\,1{}\mathrm {i}+1{}\mathrm {i}\right )}+\frac {{\mathrm {e}}^{e\,4{}\mathrm {i}+f\,x\,4{}\mathrm {i}}\,{\left (a-\frac {a\,\left ({\mathrm {e}}^{e\,2{}\mathrm {i}+f\,x\,2{}\mathrm {i}}\,1{}\mathrm {i}-\mathrm {i}\right )\,1{}\mathrm {i}}{{\mathrm {e}}^{e\,2{}\mathrm {i}+f\,x\,2{}\mathrm {i}}+1}\right )}^{2-n}\,\left (n+1\right )}{2\,f\,n\,\left (n\,1{}\mathrm {i}+1{}\mathrm {i}\right )}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (d \sec {\left (e + f x \right )}\right )^{2 n} \left (i a \left (\tan {\left (e + f x \right )} - i\right )\right )^{2 - n}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________